home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_40401.txt < prev    next >
Text File  |  1991-02-27  |  897b  |  28 lines

  1. -- card: 40401 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. C++ CUSTOM SCOPES
  11.  
  12. In addition to the extension of the C 'struct' type provided by TC, C++ provides a new user-defined type using the 'class' keyword.  Classes are defined with 'class' using the same syntax as classes defined with 'struct', except that it is possible to apply a variety of scope restrictions to the instance variables and methods of the resulting class.
  13.  
  14.     class   Rolls:Automobile
  15.     {
  16.         protected:
  17.             char         *favorite_wine[100];
  18.             int             lookup_wine_list(char*);
  19.  
  20.         public:
  21.             void           restock_wines(int);
  22.     };
  23.  
  24. The keywords 'private', 'protected', and 'public' cause members of the class to be 
  25.  
  26. -- part contents for background part 7
  27. ----- text -----
  28. 112